package com.magnificent.atlantis.client.data.message.messages;

import com.magnificent.atlantis.client.data.configuration.ServerConfiguration;
import com.magnificent.atlantis.common.entity.messages.ServerInviteMessage;
import com.magnificent.atlantis.common.entity.messages.ServerMessage;

import javax.xml.bind.annotation.XmlElement;
import java.util.ArrayList;

/**
 * User: Babanin
 * Date: 05.05.2009
 * Time: 1:07:21
 */
public class ClientInviteMessage extends ClientMeetingMessage {
    private ArrayList<Integer> invitedUsers;

    public ClientInviteMessage() {
    }

    public ClientInviteMessage(ServerInviteMessage serverInviteMessage, ServerConfiguration configuration) {
        super(serverInviteMessage, configuration);

        this.invitedUsers = serverInviteMessage.getInvited();
    }

    @XmlElement()
    public ArrayList<Integer> getInvitedUsers() {
        return invitedUsers;
    }

    public void setInvitedUsers(ArrayList<Integer> invitedUsers) {
        this.invitedUsers = invitedUsers;
    }

    public String getTitle() {
        return "Invitation to participate in meeting \"" + meetingTitle + "\"";
    }

    public ServerMessage toServerMessage() {
        ServerInviteMessage serverInviteMessage = new ServerInviteMessage();
        super.copyDataTo(serverInviteMessage);
        return serverInviteMessage;
    }
}
